package com.ruoyi.system.domain.Evaluating;

import java.util.Date;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.domain.dto.StartEvaluationDto;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 【请填写功能名称】对象 evaluation_result
 *
 * @author ruoyi
 * @date 2024-07-04
 */
public class EvaluationResult extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    @Excel(name="状态")
    private Integer status;
    @Excel(name = "标准名称")
    private String  standardName;

    /** 项目指标体系id */
    @Excel(name = "项目指标体系id")
    private Long projectId;

    /** 指标体系名称 */
    @Excel(name = "指标体系名称")
    private String projectName;

    /** 标准编号 */
    @Excel(name = "标准编号")
    private String standardCode;

    /** 评价时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "评价时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date evaluateDate;

    /** 总评结果 */
    @Excel(name = "总评结果")
    private Long outputValue;

    /** 创建者 */
    @Excel(name = "创建者")
    private String createUser;

    /** 修改者 */
    @Excel(name = "修改者")
    private String modifyUser;

    /** 修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date modifyTime;

    private String evaluationName;

    public Integer publicStatus;

    public Integer getpublicStatus() {
        return publicStatus;
    }

    public void setpublicStatus(Integer publicStatus) {
        this.publicStatus = publicStatus;
    }

    public String getEvaluationName() {
        return evaluationName;
    }

    public void setEvaluationName(String evaluationName) {
        this.evaluationName = evaluationName;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public void setProjectName(String projectName)
    {
        this.projectName = projectName;
    }

    public String getProjectName()
    {
        return projectName;
    }
    public void setStandardCode(String standardCode)
    {
        this.standardCode = standardCode;
    }

    public String getStandardCode()
    {
        return standardCode;
    }
    public void setEvaluateDate(Date evaluateDate)
    {
        this.evaluateDate = evaluateDate;
    }

    public Date getEvaluateDate()
    {
        return evaluateDate;
    }
    public void setOutputValue(Long outputValue)
    {
        this.outputValue = outputValue;
    }

    public Long getOutputValue()
    {
        return outputValue;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }

    public String getCreateUser()
    {
        return createUser;
    }
    public void setModifyUser(String modifyUser)
    {
        this.modifyUser = modifyUser;
    }

    public String getModifyUser()
    {
        return modifyUser;
    }
    public void setModifyTime(Date modifyTime)
    {
        this.modifyTime = modifyTime;
    }

    public Date getModifyTime()
    {
        return modifyTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getstandardName() {
        return standardName;
    }

    public void setstandardName(String standardName) {
        this.standardName = standardName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("projectId", getProjectId())
            .append("projectName", getProjectName())
            .append("standardCode", getStandardCode())
            .append("evaluateDate", getEvaluateDate())
            .append("outputValue", getOutputValue())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("modifyUser", getModifyUser())
            .append("modifyTime", getModifyTime())
                .append("standardName",getstandardName())
                .append("publicStatus", getpublicStatus())
            .toString();
    }
    private EvaluationResult buildEvaluationResult(Map.Entry<String, Double> entry,
                                                   StartEvaluationDto dto, String username) {
        EvaluationResult result = new EvaluationResult();
        result.setOutputValue(entry.getValue().longValue());
        result.setProjectId(dto.getSystemId());
        result.setProjectName(dto.getSystemName());
        result.setCreateUser(username);
        result.setStandardCode(entry.getKey());
        result.setEvaluationName(dto.getEvaluationName());
        result.setEvaluateDate(new Date());
        result.setpublicStatus(0);
        return result;
    }
}
